<!-- src/components/Upload/GalleryUpload.vue -->
<template>
  <BaseUpload
    v-model="modelValue"
    :max-count="15"
    :max-size="2"
    multiple
    accept="image/*"
    tip="最多上传15张图片，每张不超过2MB"
    endpoint="/upload/gallery"
    list-type="picture-card"
  />
</template>

<script setup lang="ts">
import { computed } from 'vue';
import BaseUpload from './BaseUpload.vue';

interface Props {
  modelValue?: string[]; // 明确指定为字符串数组
}

const props = defineProps<Props>();
const emit = defineEmits<{
  (e: 'update:modelValue', value: string[]): void;
}>();

const modelValue = computed({
  get: () => props.modelValue || [], // 提供默认值
  set: (value: string[]) => emit('update:modelValue', value)
});
</script>